#include <linux/init.h>
#include <linux/module.h>
#include <linux/kprobes.h>
#include "hook_tk5.h"

#ifdef TK5
static struct kprobe kp = {
    .symbol_name = "kallsyms_lookup_name"
};

kallsyms_lookup_name_t kallsyms_lookup_name_tk5;
find_module_t find_module_tk5;
int ftrace_init_tk5(void)
{
	int ret, i;

	ret = register_kprobe(&kp);
    kallsyms_lookup_name_tk5 = (kallsyms_lookup_name_t) kp.addr;
    unregister_kprobe(&kp);

	kp.symbol_name = "find_moudle";
	register_kprobe(&kp);
	find_module_tk5 = (find_module_t)kp.addr;
	unregister_kprobe(&kp);

    return 0;
}

unsigned long find_symbols(char *symbols)
{
	int ret;
	unsigned long addr;

	kp.symbol_name = symbols;
	ret = register_kprobe(&kp);
	addr = kp.addr;
	unregister_kprobe(&kp);
	return addr;
}


#endif
